package cn.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.mapper.DetailMapper;
import cn.pojo.Detail;

@Service("detailService")
@Transactional(propagation = Propagation.REQUIRED, timeout = -1)
public class DetailServiceImpl implements DetailService {
	@Resource()
	private DetailMapper detailMapper;

	// 1、获得所有的帖子明细表信息
	@Override
	public List<Detail> getAll() {
		return detailMapper.getAll();
	}

	// 2、测试用户名是否可用: testAuthor
	@Override
	public Detail testAuthor(Detail detail) {
		return detailMapper.testAuthor(detail);
	}

	// 3、ajax验证标题:testTitle
	@Override
	public Detail testTitle(Detail detail) {
		return detailMapper.testTitle(detail);
	}

	// 4、提交表单:toUserAdd
	@Override
	public int toUserAdd(Detail detail) {
		return detailMapper.toUserAdd(detail);
	}

}
